/**
 * Created by meiguizhinian on 2018/7/4
 * Copyright © 2018 lixiaolong. All rights reserved.
 */

//单例/全静态/枚举
LLNodeHelper = {
	registerAudioButton: function (formNode, name) {
		//check 状态是 音乐关闭
		let state = ivy.SoundManager.getInstance().isMusicCanPlay();
		let button = formNode.getChildByName(name, ivy.UICheckBox);
		button.setChecked(!state);
		button.onCheckChanged().add(function(node) {
			let check = node.isChecked();
			ivy.SoundManager.getInstance().setMusicCanPlay(!check);
			ivy.SoundManager.getInstance().setSoundCanPlay(!check);
			if (!check) {
				ivy.SoundManager.getInstance().playLastMusic();
			}
		});
	}
};